<template>
  <div class="right-container">
    <h3>Right 组件</h3>
    <button @click="postInfo">发起 post 请求</button>
    <button @click="btnGetBook">获取数据</button>
  </div>
</template>

<script>
// import axios from "axios";

export default {
  name: "Right",
  methods:{
    async postInfo(){
      const {data : res} = await this.$http.get('/api/post',{name:'zs',age:20})
      console.log(res)
    },
    // 获取图书数据
    async btnGetBook(){
      const {data : res} = await this.$http.get('/api/getbooks')
      console.log(res)
    }

  }
}
</script>

<style lang="less" scoped>
.right-container{
  background-color: aqua;
  min-height: 200px;
  flex: 1;
}
</style>